<?php
class Data_site_info extends CI_Controller {

	/**
	 * 显示登录页面
	 */
	public function toEdit($info) {

		$data['site_info'] = $this->data_site_info_model->get();

		$data['info'] = $info ;

		$this->load->view('admin/data/data_view_site_info',$data);
	}

	/**
	 * 执行登录操作
	 */
	public function update() {

		$site_info = $this->data_site_info_model->get();

		$site_info->site_name = $this->input->post('site_name');
		$site_info->site_url = $this->input->post('site_url');
		$site_info->telephone = $this->input->post('telephone');
		$site_info->fax = $this->input->post('fax');
		$site_info->email = $this->input->post('email');
		$site_info->address = $this->input->post('address');
		$site_info->zipcode = $this->input->post('zipcode');
		$site_info->copyright = $this->input->post('copyright');

		$site_info->index_title = $this->input->post('index_title');
		$site_info->index_keyword = $this->input->post('index_keyword');
		$site_info->index_desc = $this->input->post('index_desc');
		$site_info->publisher = $this->input->post('publisher');

		$site_info->modifier = $this->session->userdata('userId');
		$site_info->gmt_modified = date("Y-m-d H:i:s", time());

		//修改方法
		$this->data_site_info_model->update($site_info);

		$info = "修改成功";

		$this->toEdit($info);
	}

}